package com.yugao.fintech.antelope.infra.module.dict;

import com.alibaba.cloud.nacos.NacosServiceAutoConfiguration;
import com.yugao.fintech.antelope.infra.module.dict.model.entity.DictItem;
import com.yugao.fintech.antelope.base.model.constants.SecurityCons;
import com.yugao.fintech.antelope.base.model.constants.ServiceCodeCons;
import com.yugao.fintech.framework.core.response.Resp;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(contextId = "remoteDictItemService", value = ServiceCodeCons.DICT_SERVICE)
@ConditionalOnClass({FeignAutoConfiguration.class, NacosServiceAutoConfiguration.class})
public interface FeignDictItemService {

	/**
	 * 获取字典
	 */
	@GetMapping(value = "/dictItem/listByCodes", headers = SecurityCons.HEADER_FROM_IN)
	Resp<Map<String, Map<String, DictItem>>> listByCodes(@RequestParam("codes") List<String> codes);
}
